public class B08 {
    public static void main(String[] args) {
        int[] arr = {1, 5, 54, 87, 7, 6, 52, 41, 21, 84};
        int[] li = getmax(arr);
        System.out.println(li[0]);
        System.out.println(li[1]);

    }




    public static int[] getmax(int[]arr) {
        int max = arr[0];
        for (int i = 0; i < arr.length; i++) {
            if (arr[i] > max) {
                max = arr[i];
            }
        }
        int min = arr[0];
        for (int i = 0; i < arr.length; i++) {
            if (arr[i] < min) {
                min = arr[i];
            }
        };
   int[] maxmin={min,max};
     return maxmin;
    }


}
